/*
 * Copyright (C) 2011  John Lawrence thegordo.john at gmail.com
 * Licensed under GPLv3 or later. see http://www.gnu.org/copyleft/gpl.html
 */

package org.jklawrencefam.model.email;

/**
 * User: John Lawrence
 * Date: 7/14/11
 * Time: 10:29 PM
 */
public enum AddressType {
    From("from"),
    To("to"),
    CC("cc"),
    BCC("bcc");

    private String value;

    AddressType(String value) {
        this.value = value;
    }

    public static AddressType discoverAddressType(String received) {
        for (AddressType type : values()) {
            if (type.value.equalsIgnoreCase(received)) {
                return type;
            }
        }
        return null;
    }
}
